﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using System.Data.SqlClient;
using System.Data;
using Model;



namespace BLL
{
    public class QinterviewBLL
    {
        QinterviewDAL dal = new QinterviewDAL();
        /// <summary>
        /// 条件分页显示
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <param name="Firm_Name"></param>
        /// <returns></returns>
        public Pager<Interview> PageShow(int pageindex, int pagesize, string Login_Nickname)
        {
            Pager<Interview> page = new Pager<Interview>();
            page.count = Convert.ToInt32(Math.Ceiling((double)dal.count(Login_Nickname) / (double)pagesize)); //dal.count(Login_Nickname) / pagesize;
            page.pageindex = pageindex;
            page.pagesize = pagesize;
            page.Data = dal.PageShow(pageindex, pagesize, Login_Nickname);
            return page;
        }
        /// <summary>
        /// 条件分页显示我发布的面试试题
        /// </summary>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <param name="users_id"></param>
        /// <returns></returns>
        public Pager<Interview> PageShowTest(int pageindex, int pagesize, int users_id)
        {
            Pager<Interview> page = new Pager<Interview>();
            page.count = dal.countTest(users_id);
            page.pageindex = pageindex;
            page.pagesize = pagesize;
            page.Data = dal.PageShowTest(pageindex, pagesize, users_id);
            return page;
        }
    }
}
